Interrupt 21h Function 7156h
Changes the
name of the given file or directory to the new name.
mov ax, 7156h ; Rename File
mov dx, seg OldName ; see below
mov ds, dx
mov dx, offset OldName
mov di, seg NewName ; see below
mov es, di
mov di, offset NewName
int 21h
jc error
Parameters
OldName
Address of a
null-terminated string specifying the original name of the file or the
directory to rename. Long filenames are allowed.
NewName
Address of a
null-terminated string specifying the new name for the file or the directory.
The function will fail if this parameter specifies an existing file or
directory. The new name must not specify a drive different than the original
drive. Long filenames are allowed.
Return Value
Clears the
carry flag if successful. Otherwise, the function sets the carry flag and sets
the AX register to an error value.